/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.warehouse.util;

import java.util.List;

import org.dengues.model.warehouse.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see org.dengues.model.warehouse.WarehousePackage
 * @generated
 */
public class WarehouseSwitch<T> {
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public static final String copyright = "// ============================================================================\r\n//\r\n// Copyright (C) 2006-2007 Dengues\r\n//\r\n// Google Group: http://groups.google.com/group/dengues\r\n// QQ Group: 24885404\r\n//\r\n// This library is free software; you can redistribute it and/or\r\n// modify it under the terms of the GNU Lesser General Public\r\n// License as published by the Free Software Foundation; either\r\n// version 2.1 of the License.\r\n//\r\n// This library is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n// Lesser General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU General Public License\r\n// along with this program; if not, write to the Free Software\r\n// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n//\r\n// ============================================================================\r\n";
    /**
     * The cached model package
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected static WarehousePackage modelPackage;

    /**
     * Creates an instance of the switch.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public WarehouseSwitch() {
        if (modelPackage == null) {
            modelPackage = WarehousePackage.eINSTANCE;
        }
    }

    /**
     * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @return the first non-null result returned by a <code>caseXXX</code> call.
     * @generated
     */
    public T doSwitch(EObject theEObject) {
        return doSwitch(theEObject.eClass(), theEObject);
    }

    /**
     * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @return the first non-null result returned by a <code>caseXXX</code> call.
     * @generated
     */
    protected T doSwitch(EClass theEClass, EObject theEObject) {
        if (theEClass.eContainer() == modelPackage) {
            return doSwitch(theEClass.getClassifierID(), theEObject);
        }
        else {
            List<EClass> eSuperTypes = theEClass.getESuperTypes();
            return
                eSuperTypes.isEmpty() ?
                    defaultCase(theEObject) :
                    doSwitch(eSuperTypes.get(0), theEObject);
        }
    }

    /**
     * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @return the first non-null result returned by a <code>caseXXX</code> call.
     * @generated
     */
    protected T doSwitch(int classifierID, EObject theEObject) {
        switch (classifierID) {
            case WarehousePackage.BLOCK_TYPE: {
                BlockType blockType = (BlockType)theEObject;
                T result = caseBlockType(blockType);
                if (result == null) result = caseAbstractCompElement(blockType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.COLUMN_TYPE: {
                ColumnType columnType = (ColumnType)theEObject;
                T result = caseColumnType(columnType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.CONNECTION_TYPE: {
                ConnectionType connectionType = (ConnectionType)theEObject;
                T result = caseConnectionType(connectionType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.DOCUMENT_ROOT: {
                DocumentRoot documentRoot = (DocumentRoot)theEObject;
                T result = caseDocumentRoot(documentRoot);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.ELEMENT_PARAMETER_TYPE: {
                ElementParameterType elementParameterType = (ElementParameterType)theEObject;
                T result = caseElementParameterType(elementParameterType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.METADATA_TYPE: {
                MetadataType metadataType = (MetadataType)theEObject;
                T result = caseMetadataType(metadataType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.NODE_TYPE: {
                NodeType nodeType = (NodeType)theEObject;
                T result = caseNodeType(nodeType);
                if (result == null) result = caseAbstractCompElement(nodeType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.NOTE_TYPE: {
                NoteType noteType = (NoteType)theEObject;
                T result = caseNoteType(noteType);
                if (result == null) result = caseAbstractCompElement(noteType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.PROCESS_TYPE: {
                ProcessType processType = (ProcessType)theEObject;
                T result = caseProcessType(processType);
                if (result == null) result = caseStorage(processType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.ABSTRACT_COMP_ELEMENT: {
                AbstractCompElement abstractCompElement = (AbstractCompElement)theEObject;
                T result = caseAbstractCompElement(abstractCompElement);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.STORAGE: {
                Storage storage = (Storage)theEObject;
                T result = caseStorage(storage);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.FILE_STORAGE: {
                FileStorage fileStorage = (FileStorage)theEObject;
                T result = caseFileStorage(fileStorage);
                if (result == null) result = caseStorage(fileStorage);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.SCRIPTS_STORAGE: {
                ScriptsStorage scriptsStorage = (ScriptsStorage)theEObject;
                T result = caseScriptsStorage(scriptsStorage);
                if (result == null) result = caseFileStorage(scriptsStorage);
                if (result == null) result = caseStorage(scriptsStorage);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.ELEMENT_VALUE_TYPE: {
                ElementValueType elementValueType = (ElementValueType)theEObject;
                T result = caseElementValueType(elementValueType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            case WarehousePackage.BLOCK_EXIT_TYPE: {
                BlockExitType blockExitType = (BlockExitType)theEObject;
                T result = caseBlockExitType(blockExitType);
                if (result == null) result = caseBlockType(blockExitType);
                if (result == null) result = caseAbstractCompElement(blockExitType);
                if (result == null) result = defaultCase(theEObject);
                return result;
            }
            default: return defaultCase(theEObject);
        }
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Block Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Block Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseBlockType(BlockType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Column Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Column Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseColumnType(ColumnType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Connection Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Connection Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseConnectionType(ConnectionType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Document Root</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Document Root</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseDocumentRoot(DocumentRoot object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Element Parameter Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Element Parameter Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseElementParameterType(ElementParameterType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Metadata Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Metadata Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseMetadataType(MetadataType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Node Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Node Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseNodeType(NodeType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Note Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Note Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseNoteType(NoteType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Process Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Process Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseProcessType(ProcessType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Abstract Comp Element</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Abstract Comp Element</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseAbstractCompElement(AbstractCompElement object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Storage</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Storage</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseStorage(Storage object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>File Storage</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>File Storage</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseFileStorage(FileStorage object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Scripts Storage</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Scripts Storage</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseScriptsStorage(ScriptsStorage object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Element Value Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Element Value Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseElementValueType(ElementValueType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>Block Exit Type</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>Block Exit Type</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
     * @generated
     */
    public T caseBlockExitType(BlockExitType object) {
        return null;
    }

    /**
     * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
     * <!-- begin-user-doc -->
     * This implementation returns null;
     * returning a non-null result will terminate the switch, but this is the last case anyway.
     * <!-- end-user-doc -->
     * @param object the target of the switch.
     * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
     * @see #doSwitch(org.eclipse.emf.ecore.EObject)
     * @generated
     */
    public T defaultCase(EObject object) {
        return null;
    }

} //WarehouseSwitch
